package com.tanhua.server.controller;

import com.tanhua.server.serivce.PeachService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
@RequestMapping
@Slf4j
public class PeachController {
    @Autowired
    private PeachService peachService;

    @PostMapping("/peachblossom")
    private ResponseEntity<Object> sendVoice(@RequestBody MultipartFile soundFile) throws IOException {
        log.info("传音发送");
        return  peachService.sendVoice(soundFile);
    }
    @GetMapping("/peachblossom")
    private ResponseEntity<Object> acceptVoice(){
        log.info("传音接收");
        return  peachService.acceptVoice();
    }
}
